package com.xxadmin.common.vo;

import com.xxadmin.common.constant.ResponseEnum;
import lombok.Data;

import java.io.Serializable;

/**
 * ResponseModel
 *
 * @author:chenming
 * @date:2018/8/22
 */
@Data
public class ResponseModel<T> implements Serializable {

    private String code;

    private String message;

    private T data;

    protected ResponseModel(){

    }

    protected ResponseModel(String code, String msg){
        this.code = code;
        this.message = msg;
        this.data = null;
    }

    protected ResponseModel(String code, String msg, T data){
        this.code = code;
        this.message = msg;
        this.data = data;
    }

    protected ResponseModel(ResponseEnum responseEnum){
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMessage();
    }
}
